
import Vue from 'vue'
import App from './App'
import router from './router'
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';
import Api from './axios/index'
import '@/style/index.less';
import { getJurisdiction } from './utils/index'
Vue.config.productionTip = false;
Vue.use(Antd);
Vue.prototype.Api = Api;
Vue.prototype.getJurisdiction = getJurisdiction;
Vue.prototype.resetSetItem = function (key, newVal) {
  if (key === 'search') {
    // 创建一个StorageEvent事件
    let newStorageEvent = document.createEvent('StorageEvent');
    const storage = {
      setItem: function (k, val) {
        sessionStorage.setItem(k, val);

        // 初始化创建的事件
        newStorageEvent.initStorageEvent('setItem', false, false, k, null, val, null, null);

        // 派发对象
        window.dispatchEvent(newStorageEvent)
      }
    };
    return storage.setItem(key, newVal);
  }
};
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
});
